const storeSelect = [
  {
    label: '门店1',
    value: 0
  },
  {
    label: '门店2',
    value: 1
  }
]
Page({
  data: {
    name: '',
    password: '',
    store: '',
    storeSelect: storeSelect.map(res => res.label)
  },
  goPage() {
    if (this.data.name === '' || this.data.password === '' || this.data.store === '') {
      wx.showToast({
        title: '尚未填写完整',
        icon: 'none'
      })
      return
    }
    wx.redirectTo({
      url: '../index/index',
    })
  },

  onStoreChange(data: { detail: { value: any } }) {
    const value = data.detail.value
    const store = storeSelect.find(res => {
      return res.value === parseInt(value)
    })
    store && this.setData({
      store: store.label
    })
    store && (getApp().store = store.value + 1)
  },


})
